package threading;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadDemo24 {
    public static void main(String[] args) {
        //创建一个10线程的线程池
        ExecutorService pool = Executors.newFixedThreadPool(10);
        //不会固定 , 按需创建 , 用完之后也不会立即销毁 , 留着以后备用
        Executors.newCachedThreadPool();



        pool.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("pool");
            }
        });
    }
}
